<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>修改记录</title>
    <script>
    function  showUserTip2() {
      document.getElementById('userTip2').innerHTML = '<b style="color: lightgray;">课序号不能为空</b>';
    }

    function  checkUser2() {
      var name = document.getElementById('2').value;
      if (name === ''){
        document.getElementById('userTip2').innerHTML = '<b style="color: red">课序号不能为空</b>'
        return 0;
      }else{
        document.getElementById('userTip2').innerHTML = '<b style="color:  green"> ok </b>'
        return 1;
      }
    }

    function  showUserTip3() {
      document.getElementById('userTip3').innerHTML = '<b style="color: lightgray;">选课人数上限不能为空</b>';
    }

    function  checkUser3() {
      var name = document.getElementById('3').value;
      if (name === ''){
        document.getElementById('userTip3').innerHTML = '<b style="color: red">选课人数不能为空</b>'
        return 0;
      }else{
        document.getElementById('userTip3').innerHTML = '<b style="color:  green"> ok </b>'
        return 1;
      }
    }

    function  showUserTip4() {
      document.getElementById('userTip4').innerHTML = '<b style="color: lightgray;">开课学期不能为空</b>';
    }

    function  checkUser4() {
        var name = document.getElementById('4').value;
        if (name === '') {
            document.getElementById('userTip4').innerHTML = '<b style="color: red">开课学期不能为空</b>'
            return 0;
        } else {
            document.getElementById('userTip4').innerHTML = '<b style="color:  green"> ok </b>'
            return 1;
        }
    }
  </script>
</head>
<body>
<h3>请输入要修改记录的相关信息</h3>
<form id="form1" name="form1" method="post" action="/updatewx5">
    <label>排课ID：{{data[0]}}
        <input type="hidden" name="stu_id" value='{{data[0]}}'/>
<!--        定义隐藏的输入字段。-->
    </label>
    <p>
    <label>课程编号：
     <select type="text" name="stu_name">
    {% for pro in prro -%}
      <option value='{{pro[0]}}'>{{pro[0]}}</option>
    {%endfor-%}
    </select>
    </label>
    </p>
    <p>
        <label>课序号：
            <input type="text" name="stu_sex" value='{{data[2]}}'id="2" placeholder="输入课序号" onfocus="showUserTip2()" onblur="checkUser2()"/>
        </label>
        <span id="userTip2"></span>
    </p>
    <p>
        <label>教师编号：
            <select type="text" name="stu_age">
                {% for pro in pro -%}
                <option value='{{pro[0]}}'>{{pro[0]}}</option>
                {%endfor-%}
            </select>
        </label>
    </p>
    <p>
        <label>选课人数上限：
            <input type="text" name="stu_profession" value='{{data[4]}}'id="3" placeholder="输入选课人数上限" onfocus="showUserTip3()" onblur="checkUser3()"/>
        </label>
        <span id="userTip3"></span>
    </p>
    <p>
        <label>开课学期：
            <input type="text" name="stu_aage" value='{{data[5]}}'id="4" placeholder="输入开课学期" onfocus="showUserTip4()" onblur="checkUser4()"/>
        </label>
        <span id="userTip4"></span>
    </p>
    <p>
        <label>
            <input type="submit" name="button" value="提交"/>
        </label>
        <label>
            <input type="reset" name="button2" value="重置"/>
        </label>
        <br/>
    </p>
</form>
</body>
</html>